package com.design.mode.template;

/**
 * Created by lucky on 2018/9/14.
 */
public class StringPrint extends AbstractPrint{
    private String string;

    public StringPrint(String string){
        this.string = string;
    }

    public void start() {
        printLine();
    }

    public void close() {
        printLine();
    }

    public void print() {
        System.out.println("|"+string+"|");
    }

    private void printLine(){
        System.out.print("+");
        for (int i = 0 ; i< string.length() ; i++){
            System.out.print("-");
        }
        System.out.println("+");
    }
}
